<template>
<el-row class="flex">
  <el-col :span="6" class="title">思异巴德州扑克后台管理系统</el-col>
  <el-col :span="4" style="color:#909399;font-size:14px;">V0.1.3.180301_build</el-col>
  <el-col :span="4" :offset="15" class="float">
    <span style="margin-right:15px;boder:1px  #wirte;">{{forms.username}}</span>
    <el-button type="danger" size="mini" round @click="exit">退出</el-button>
  </el-col>
</el-row>

</template>

<style lang="">

.float{
  width:200px;
  float:right;
}
    .el-row{
      height:70px;
      background-color: #242f42;
      color: white;
      line-height:70px;
   }
  .title{
    min-width:150px;
    font-size: 22px;
  }
  .el-col-offset-15 {
    margin-left: 0;
  }
</style>
<script>
export default {
    data () {
      return {
          forms:[],
      }
    },
    created(){
      this.getuser();
    },
    methods: {
      getuser(){
        this.$api.user(this.form).then(res=>{
            if(res.code=='000000'){
              this.forms = res.data;
              console.log('this.forms')
              console.log(this.forms)
            }
          });
      },
      exit(){
        this.$confirm('您确定要退出该平台吗, 是否继续?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          this.$api.logout().then(res => {
            if (res.code === '000000') {
              this.$message.success('退出成功')
              this.$router.push('/login')
            }
          })
        }).catch(() => {
          this.$message({
            type: 'info',
            message: '已取消删除'
          })
        })
      }
    }
  }
  
</script>